/** @format */

// Author 区区电脑
// Email 1573580882@qq.com
// Date 2021-05-27
// Copyright © 2021 gys. All rights reserved.
import LocalDB from "@/utils/LocalDB.js"

const localUserInfo = LocalDB.getItem("userInfo")

const user = {
    state: {
        userInfo: localUserInfo && localUserInfo.data ? localUserInfo.data : {},
    },
    mutations: {
        userInfo(state, value) {
            state.userInfo = value;
            LocalDB.setItem("userInfo", value)
        },
    },
    actions: {
        userInfo({commit}, value) {
            commit("userInfo", value);
        },
    },
};

export default user;
